#ifndef _SENSOR_RECEIVER_H_
#define _SENSOR_RECEIVER_H_

#include "modules/common_msgs/sensor_msgs/pointcloud.pb.h"
#include "modules/drivers/lidar/orin_hesai/common/data_type.h"
#include "modules/drivers/lidar/orin_hesai/hesai_utils/hesai_data_type.h"
#include "modules/drivers/lidar/orin_hesai/hesai_utils/hesai_sdk.h"
#include "modules/drivers/lidar/orin_hesai/common/data_buffer.h"

namespace apollo {
namespace drivers {
namespace lidar_hesai {
class LidarReceiver {
 public:
  LidarReceiver();
  ~LidarReceiver() {};
  bool Init(std::shared_ptr<CircularQueueBuffer<LidarPacket>> packet_buffer,
            const uint32_t firing_data_port);
  void Start();
  static LidarReceiver* self;

 private:
  static void OnHesaiLidarData(LidarPacket* pkt);

  std::shared_ptr<CircularQueueBuffer<LidarPacket>> packet_buffer_;
  std::shared_ptr<HesaiSDK> hesai_sdk_;
};

}  // namespace lidar_hesai
}  // namespace drivers
}  // namespace apollo
#endif
